package gold.digger;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by fanzhenyu02 on 2020/6/27.
 * common problem solver template.
 */
public class LC1381 {
    public long startExecuteTime = System.currentTimeMillis();


    class CustomStack {
        int[] stack;
        int top;

        public CustomStack(int maxSize) {
            stack = new int[maxSize];
            top = -1;
        }

        public void push(int x) {
            if (top != stack.length - 1) {
                ++top;
                stack[top] = x;
            }
        }

        public int pop() {
            if (top == -1) {
                return -1;
            }
            --top;
            return stack[top + 1];
        }

        public void increment(int k, int val) {
            int limit = Math.min(k, top + 1);
            for (int i = 0; i < limit; ++i) {
                stack[i] += val;
            }
        }
    }


    public void run() {
        CustomStack solution = new CustomStack(10);
        List<Integer> list = new ArrayList<>();
        System.out.println(solution.toString());
    }

    public static void main(String[] args) throws Exception {
        LC1381 an = new LC1381();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
